<?php

$filename = $_GET['fn'];

if(!empty($filename) && file_exists($filename))
	echo gzip(file_get_contents($filename));

function gzip($content = ''){
    if(!headers_sent() && extension_loaded("zlib") && strpos($_SERVER["HTTP_ACCEPT_ENCODING"], 'gzip') !== false){
        $content = gzencode($content, 1);
        header("Content-Encoding: gzip");
    }
    return $content;
}
?>
